﻿using Microsoft.EntityFrameworkCore;
using MySystemSetup.BusinessDomain;
using MySystemSetup.RBACDomain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;

namespace FinalItem.SzrModule
{
   
    public class SzrModuleMigrationsDbContext : AbpDbContext<SzrModuleMigrationsDbContext>
    {
        public SzrModuleMigrationsDbContext(DbContextOptions<SzrModuleMigrationsDbContext> options) : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.Entity<Permission>(b =>
            {
                //Configure table & schema name
                b.ToTable("Permission");

               // b.ConfigureByConvention();


            });

            modelBuilder.Entity<RoleInfo>(b =>
            {
                //Configure table & schema name
                b.ToTable("RoleInfo");
                b.ConfigureByConvention();

                // b.ConfigureByConvention();


            });

            modelBuilder.Entity<RolePermission>(b =>
            {
                //Configure table & schema name
                b.ToTable("RolePermission");

               // b.ConfigureByConvention();


            });
            modelBuilder.Entity<UserInfo>(b =>
            {
                //Configure table & schema name
                b.ToTable("UserInfo");

               // b.ConfigureByConvention();


            });
            modelBuilder.Entity<UserRole>(b =>
            {
                //Configure table & schema name
                b.ToTable("UserRole");

               /// b.ConfigureByConvention();


            });

            modelBuilder.Entity<SheepYard>(b =>
            {
                //Configure table & schema name
                b.ToTable("SheepYard");

                /// b.ConfigureByConvention();


            });

            modelBuilder.Entity<GiveInfo>(b =>
            {
                //Configure table & schema name
                b.ToTable("GiveInfo");

                /// b.ConfigureByConvention();


            });
            modelBuilder.Entity<FieldInfo>(b =>
            {
                //Configure table & schema name
                b.ToTable("FieldInfo");

                /// b.ConfigureByConvention();


            });
            modelBuilder.Entity<Entrepreneur>(b =>
            {
                //Configure table & schema name
                b.ToTable("Entrepreneur");

                /// b.ConfigureByConvention();


            });
            
            //modelBuilder.ConfigureMyModule();
        }
    }
}
